import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class ArticlesListVo {
  List<ArticlesItem>? data;
  Meta? meta;

  ArticlesListVo({this.data, this.meta});

  ArticlesListVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = [];
      json['data'].forEach((v) {
        data!.add(new ArticlesItem.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new Meta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class ArticlesItem {
  int? id;
  String? title;
  String? image;
  int? sort;
  int? isShow;
  int? vists;
  int? likes;

  ArticlesItem(
      {this.id,
      this.title,
      this.image,
      this.sort,
      this.isShow,
      this.vists,
      this.likes});

  ArticlesItem.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    image = json['image'];
    sort = json['sort'];
    isShow = json['is_show'];
    vists = json['vists'];
    likes = json['likes'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['image'] = this.image;
    data['sort'] = this.sort;
    data['is_show'] = this.isShow;
    data['vists'] = this.vists;
    data['likes'] = this.likes;
    return data;
  }
}

class Meta {
  CommonPagination? pagination;

  Meta({this.pagination});

  Meta.fromJson(Map<String, dynamic> json) {
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}